cmake_minimum_required(VERSION 3.0)
project(yuv2gl)

set(CMAKE_CXX_STANDARD 17)

set(DIR_INCLUDES ${PROJECT_SOURCE_DIR}/include)
include_directories(${DIR_INCLUDES})

add_subdirectory(lib/glfw)

# vk
#add_definitions(-DVK_USE_PLATFORM_WIN32_KHR)
#add_definitions(-DVK_USE_PLATFORM_MACOS_MVK)
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)

find_package(Vulkan REQUIRED)
if(Vulkan_FOUND)
    message("Find vulkan success!")
    include_directories(${Vulkan_INCLUDE_DIRS})
endif()

add_subdirectory(lib/glm)

# GPU 渲染
add_executable(${PROJECT_NAME}
        src/main.cpp
        src/gl/glad.c
        src/gl/GLRenderer.cpp
        src/gl/GLRenderer.h
        src/gl/GLYuvTexture.h
        src/gl/GLRgbTexture.h
        src/gl/GLShaders.h

        src/vk/VulkanCommon.h
        src/vk/VkBundle.h
        src/vk/VkHelper.cpp
        src/vk/VkHelper.h
        src/vk/Texture.cpp
        src/vk/Texture.h
        src/vk/Geometry.cpp
        src/vk/Geometry.h
        src/vk/Headers.h
        src/vk/VkRenderer.cpp
        src/vk/VkRenderer.h
        )
target_include_directories(${PROJECT_NAME} PUBLIC lib/glfw/include ${Vulkan_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC glfw glm ${Vulkan_LIBRARY})
#
## CPU 转换
#add_executable(yuv2rgb_cpu src/cpu/WritePng.h src/cpu/main.cpp)

add_executable(LutYuv src/LutYuv/LutYuv.cpp src/gl/glad.c src/gl/GLShaders.h src/cpu/WritePng.h)
target_link_libraries(LutYuv PUBLIC glfw)

#add_executable(LUT3D_CPP src/LutYuv/LUT3D_CPP.cpp)
#add_executable(LUT3D_CPP_exe src/LutYuv/file/LUT3D_CPP.cpp)